<ResourceDictionary
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:c="comment"
   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
   xmlns:System="clr-namespace:System;assembly=mscorlib"
   xmlns:controls="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"
   xmlns:vsm="clr-namespace:System.Windows;assembly=PresentationFramework"
   xmlns:mwt="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
   xmlns:local="clr-namespace:LogoFX.Controls"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:Internal="clr-namespace:Internal"
   xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
   xmlns:Interactivity1="clr-namespace:LogoFX.Infra.Interactivity"
   mc:Ignorable="c">
  
  <SolidColorBrush x:Key="MenuPanelDropDownTriangleBrush" Color="#8d0223"/>
  <SolidColorBrush x:Key="ZoombarBorderBrush" Color="#CFD2D5"/>
  <SolidColorBrush x:Key="ZoombarBackgroundBrush" Color="#F2F6FA"/>
  <SolidColorBrush x:Key="ZoombarThumbBorderBrush" Color="#B2BCC5"/>
  <LinearGradientBrush x:Key="ZoombarThumbBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Offset="0.0" Color="#FAFAFB"/>
    <GradientStop Offset="1.0" Color="#DFE2E5"/>
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ZoombarThumbFromBackgroundBrush" Color="#F9F9FA"/>
  <SolidColorBrush x:Key="ZoombarThumbToBackgroundBrush" Color="#DFE2E5"/>
  <LinearGradientBrush x:Key="ZoombarThumbFillerBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Offset="0.0" Color="#DFE2E5"/>
    <GradientStop Offset="1.0" Color="#FAFAFB"/>
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ZoombarThumbHandleBackgroundBrush" Color="#C0C7CE"/>
  <SolidColorBrush x:Key="ZoombarThumbHandleTopBorderBrush" Color="#A6ACB3"/>
  <SolidColorBrush x:Key="ZoombarThumbHandleBottomBorderBrush" Color="#F2F3F4"/>
  <SolidColorBrush x:Key="SwitchboardBorderBrush" Color="#D7DBDE"/>
  <SolidColorBrush x:Key="SwitchboardBackgroundBrush" Color="#DDE6EC"/>
  <SolidColorBrush x:Key="SummaryBorderBrush" Color="#DBE1E6"/>
  <SolidColorBrush x:Key="SummaryTitleBackgroundBrush" Color="#437CA9"/>
  <SolidColorBrush x:Key="SummaryTitleColor" Color="#FFFFFF"/>
  <SolidColorBrush x:Key="SummaryBasicParameterColor" Color="#000000"/>
  <SolidColorBrush x:Key="SummaryBasicParameterUnitsColor" Color="#434343"/>
  <SolidColorBrush x:Key="SummaryMinMaxAvgBackgroundBrush" Color="#EEF2F4"/>
  <SolidColorBrush x:Key="SummaryMinMaxAvgLightBackgroundBrush" Color="#FFFFFF"/>
  <SolidColorBrush x:Key="SummaryMinMaxAvgColor" Color="#000000"/>
  <SolidColorBrush x:Key="SummaryMinMaxAvgNameColor" Color="#434343"/>
  <Internal:BoolToVisibilityConverter x:Key="boolToVisibilityConverter">
  </Internal:BoolToVisibilityConverter>
  <Internal:BoolToConstConverter x:Key="btcc">
  </Internal:BoolToConstConverter>
  <Internal:BoolToVisibilityConverter x:Key="btvc">
  </Internal:BoolToVisibilityConverter>
  <DataTemplate x:Key="EmptyTemplate">
    <Grid>
    </Grid>
  </DataTemplate>
  <ControlTemplate x:Key="CommonValidationToolTipTemplate" TargetType="ToolTip">
    <Grid
       x:Name="Root"
       Margin="5,0"
       Opacity="0"
       RenderTransformOrigin="0,0">
      <Grid.RenderTransform>
        <TranslateTransform x:Name="Translation" X="-25"/>
      </Grid.RenderTransform>
      <vsm:VisualStateManager.VisualStateGroups>
        <vsm:VisualStateGroup x:Name="OpenStates">
          <vsm:VisualStateGroup.Transitions>
            <vsm:VisualTransition GeneratedDuration="0"/>
            <vsm:VisualTransition GeneratedDuration="0:0:0.2" To="Open">
              <Storyboard>
                <DoubleAnimation
                   Duration="0:0:0.2"
                   Storyboard.TargetName="Translation"
                   Storyboard.TargetProperty="X"
                   To="0">
                  <DoubleAnimation.EasingFunction>
                    <BackEase Amplitude=".3" EasingMode="EaseOut"/>
                  </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <DoubleAnimation
                   Duration="0:0:0.2"
                   Storyboard.TargetName="Root"
                   Storyboard.TargetProperty="Opacity"
                   To="1"/>
              </Storyboard>
            </vsm:VisualTransition>
          </vsm:VisualStateGroup.Transitions>
          <vsm:VisualState x:Name="Closed">
            <Storyboard>
              <DoubleAnimation
                 Duration="0"
                 Storyboard.TargetName="Root"
                 Storyboard.TargetProperty="Opacity"
                 To="0"/>
            </Storyboard>
          </vsm:VisualState>
          <vsm:VisualState x:Name="Open">
            <Storyboard>
              <DoubleAnimation
                 Duration="0"
                 Storyboard.TargetName="Translation"
                 Storyboard.TargetProperty="X"
                 To="0"/>
              <DoubleAnimation
                 Duration="0"
                 Storyboard.TargetName="Root"
                 Storyboard.TargetProperty="Opacity"
                 To="1"/>
            </Storyboard>
          </vsm:VisualState>
        </vsm:VisualStateGroup>
      </vsm:VisualStateManager.VisualStateGroups>
      <Border Margin="4,4,-4,-4" Background="#052A2E31" CornerRadius="5"/>
      <Border Margin="3,3,-3,-3" Background="#152A2E31" CornerRadius="4"/>
      <Border Margin="2,2,-2,-2" Background="#252A2E31" CornerRadius="3"/>
      <Border Margin="1,1,-1,-1" Background="#352A2E31" CornerRadius="2"/>
      <Border Background="#FFDC000C" CornerRadius="2">
        <TextBlock
           MaxWidth="250"
           Margin="8,4,8,4"
           Foreground="White"
           Text="{Binding (Validation.Errors)[0].ErrorContent}"
           TextWrapping="Wrap"
           UseLayoutRounding="false"/>
      </Border>
    </Grid>
  </ControlTemplate>
  <Style TargetType="local:ImageButton">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:ImageButton">
          <Grid x:Name="rootGrid">
            <vsm:VisualStateManager.VisualStateGroups>
              <vsm:VisualStateGroup x:Name="CommonStates">
                <vsm:VisualStateGroup.Transitions>
                  <vsm:VisualTransition From="Normal" GeneratedDuration="00:00:00" To="Pressed"/>
                  <vsm:VisualTransition From="Pressed" GeneratedDuration="00:00:00" To="Normal"/>
                </vsm:VisualStateGroup.Transitions>
                <vsm:VisualState x:Name="Normal"/>
                <vsm:VisualState x:Name="MouseOver">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="Pressed">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="PressedImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="PressedImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation
                       Duration="0"
                       Storyboard.TargetName="content"
                       Storyboard.TargetProperty="Opacity"
                       To=".55"/>
                  </Storyboard>
                </vsm:VisualState>
              </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>
            <Grid x:Name="content" Margin="{TemplateBinding Padding}">
              <!--<Canvas>-->
              <Image x:Name="NormalImage" Source="{TemplateBinding NormalImage}"/>
              <Image x:Name="HoverImage" Source="{TemplateBinding HoverImage}" Visibility="Collapsed"/>
              <Image x:Name="PressedImage" Source="{TemplateBinding PressedImage}" Visibility="Collapsed"/>
              <Image x:Name="DisabledImage" Source="{TemplateBinding DisabledImage}" Visibility="Collapsed"/>
              <!--</Canvas>-->
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:ImageToggleButton">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:ImageToggleButton">
          <Grid x:Name="rootGrid">
            <vsm:VisualStateManager.VisualStateGroups>
              <vsm:VisualStateGroup x:Name="CommonStates">
                <vsm:VisualStateGroup.Transitions>
                  <vsm:VisualTransition From="Normal" GeneratedDuration="00:00:00" To="Pressed"/>
                  <vsm:VisualTransition From="Pressed" GeneratedDuration="00:00:00" To="Normal"/>
                </vsm:VisualStateGroup.Transitions>
                <vsm:VisualState x:Name="Normal"/>
                <vsm:VisualState x:Name="MouseOver">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="Pressed">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="PressedImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="PressedImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledImage" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation
                       Duration="0"
                       Storyboard.TargetName="content"
                       Storyboard.TargetProperty="Opacity"
                       To=".55"/>
                  </Storyboard>
                </vsm:VisualState>
              </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>
            <Grid x:Name="content" Margin="{TemplateBinding Padding}">
              <!--<Canvas>-->
              <Image x:Name="NormalImage" Source="{TemplateBinding NormalImage}">
              </Image>
              <Image x:Name="HoverImage" Source="{TemplateBinding HoverImage}" Visibility="Collapsed">
              </Image>
              <Image x:Name="PressedImage" Source="{TemplateBinding PressedImage}" Visibility="Collapsed">
              </Image>
              <Image x:Name="DisabledImage" Source="{TemplateBinding DisabledImage}" Visibility="Collapsed">
              </Image>
              <!--</Canvas>-->
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:ZoomBar">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:ZoomBar">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <!--DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">-->
            <!--<Border CornerRadius="1,1,1,1" 
                  BorderThickness="1" 
                  BorderBrush="{StaticResource ZoombarBorderBrush}" 
                  Background="{StaticResource ZoombarBackgroundBrush}">-->
            <Grid>
              <ContentPresenter Content="{TemplateBinding PreviewContent}">
              </ContentPresenter>
              <Grid x:Name="ZoombarTemplate">
                <Interactivity:Interaction.Behaviors>
                  <Interactivity1:MeasurementBehavior></Interactivity1:MeasurementBehavior>
                </Interactivity:Interaction.Behaviors>
                <Grid.Resources>
                  <ControlTemplate x:Key="ZoombarRangeThumbTemplate" TargetType="controls:GridSplitter">
                    <Grid>
                      <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                          <VisualState x:Name="Normal"/>
                          <VisualState x:Name="MouseOver"/>
                          <VisualState x:Name="Disabled"/>
                        </VisualStateGroup>
                      </VisualStateManager.VisualStateGroups>
                      <!--<Rectangle x:Name="DisabledOverlay" Visibility="Collapsed" Opacity=".55" Stroke="#FFA3AEB9" Fill="White" />-->
                      <Grid
                         HorizontalAlignment="Stretch"
                         VerticalAlignment="Stretch"
                         Cursor="Hand"
                         Visibility="Collapsed">
                        <Grid.Effect>
                          <DropShadowEffect
                             BlurRadius="1"
                             Color="Gray"
                             Direction="-20"
                             Opacity="1"
                             ShadowDepth="2">
                          </DropShadowEffect>
                        </Grid.Effect>
                        <Grid.ColumnDefinitions>
                          <ColumnDefinition Width="5"/>
                          <ColumnDefinition/>
                          <ColumnDefinition Width="5"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                          <RowDefinition Height="5"/>
                          <RowDefinition/>
                          <RowDefinition Height="5"/>
                        </Grid.RowDefinitions>
                        <Border
                           Grid.Column="0"
                           Grid.ColumnSpan="2"
                           Grid.Row="0"
                           Background="AliceBlue"
                           BorderBrush="SteelBlue"
                           BorderThickness="1,1,0,0"
                           CornerRadius="2,0,0,0"
                           Opacity="0.9">
                        </Border>
                        <Border
                           Grid.Column="2"
                           Grid.Row="0"
                           Grid.RowSpan="2"
                           Background="AliceBlue"
                           BorderBrush="SteelBlue"
                           BorderThickness="0,1,1,0"
                           CornerRadius="0,2,0,0"
                           Opacity="0.9">
                        </Border>
                        <Border
                           Grid.Column="1"
                           Grid.ColumnSpan="2"
                           Grid.Row="2"
                           Background="AliceBlue"
                           BorderBrush="SteelBlue"
                           BorderThickness="0,0,1,1"
                           CornerRadius="0,0,2,0"
                           Opacity="0.9">
                        </Border>
                        <Border
                           Grid.Column="0"
                           Grid.Row="1"
                           Grid.RowSpan="2"
                           Background="AliceBlue"
                           BorderBrush="SteelBlue"
                           BorderThickness="1,0,0,1"
                           CornerRadius="0,0,0,2"
                           Opacity="0.9">
                        </Border>
                        <Border
                           Grid.Column="1"
                           Grid.Row="1"
                           Background="Transparent"
                           BorderBrush="SteelBlue"
                           BorderThickness="1,1,1,1"
                           CornerRadius="2">
                        </Border>
                      </Grid>
                      <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Cursor="Hand">
                        <Grid.ColumnDefinitions>
                          <ColumnDefinition Width="3"/>
                          <ColumnDefinition/>
                          <ColumnDefinition Width="3"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                          <RowDefinition Height="5"/>
                          <RowDefinition/>
                          <RowDefinition Height="5"/>
                        </Grid.RowDefinitions>
                        <Border
                           Grid.Column="0"
                           Grid.ColumnSpan="3"
                           Grid.Row="0"
                           Background="{StaticResource ZoombarThumbFromBackgroundBrush}"
                           BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                           BorderThickness="0,1,0,0"/>
                        <Border
                           Grid.Column="0"
                           Grid.ColumnSpan="3"
                           Grid.Row="2"
                           Background="{StaticResource ZoombarThumbToBackgroundBrush}"
                           BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                           BorderThickness="0,0,0,1"/>
                        <Border
                           Grid.Column="0"
                           Grid.ColumnSpan="3"
                           Grid.Row="1"
                           Background="{StaticResource ZoombarThumbFillerBackgroundBrush}"
                           BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                           BorderThickness="0,0,0,0"
                           CornerRadius="1"
                           Opacity="0.5"/>
                        <Border
                           Grid.Column="0"
                           Grid.ColumnSpan="3"
                           Grid.Row="1"
                           Background="Transparent"
                           BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                           BorderThickness="1,1,1,1"
                           CornerRadius="1"/>
                      </Grid>
                    </Grid>
                  </ControlTemplate>
                  <ControlTemplate x:Key="ZoombarLeftThumbTemplate" TargetType="controls:GridSplitter">
                    <Grid>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="4*"/>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="3*"/>
                      </Grid.ColumnDefinitions>
                      <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                      </Grid.RowDefinitions>
                      <Border
                         Grid.Column="0"
                         Grid.ColumnSpan="3"
                         Grid.Row="0"
                         Grid.RowSpan="3"
                         Background="{StaticResource ZoombarThumbBackgroundBrush}"
                         BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                         BorderThickness="1,1,0,1"
                         CornerRadius="3,0,0,3"/>
                      <Border Grid.Column="1" Grid.Row="1" Background="{StaticResource ZoombarThumbHandleBackgroundBrush}"/>
                    </Grid>
                  </ControlTemplate>
                  <ControlTemplate x:Key="ZoombarRightThumbTemplate" TargetType="controls:GridSplitter">
                    <Grid>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="4*"/>
                      </Grid.ColumnDefinitions>
                      <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                      </Grid.RowDefinitions>
                      <Border
                         Grid.Column="0"
                         Grid.ColumnSpan="3"
                         Grid.Row="0"
                         Grid.RowSpan="3"
                         Background="{StaticResource ZoombarThumbBackgroundBrush}"
                         BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                         BorderThickness="0,1,1,1"
                         CornerRadius="0,3,3,0"/>
                      <Border Grid.Column="1" Grid.Row="1" Background="{StaticResource ZoombarThumbHandleBackgroundBrush}"/>
                    </Grid>
                  </ControlTemplate>
                </Grid.Resources>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition x:Name="LowerPart" MinWidth="10"/>
                  <ColumnDefinition x:Name="RangePart"/>
                  <ColumnDefinition x:Name="UpperPart" MinWidth="10"/>
                </Grid.ColumnDefinitions>
                <Border
                   x:Name="LowerBorder"
                   Grid.Column="0"
                   HorizontalAlignment="Stretch"
                   VerticalAlignment="Stretch"
                   Background="LightGray"
                   Opacity="0.2"/>
                <Border
                   x:Name="UpperBorder"
                   Grid.Column="2"
                   HorizontalAlignment="Stretch"
                   VerticalAlignment="Stretch"
                   Background="LightGray"
                   Opacity="0.2"/>
                <controls:GridSplitter
                   x:Name="LowerThumb"
                   Width="10"
                   Grid.Column="0"
                   HorizontalAlignment="Right"
                   Template="{StaticResource ZoombarLeftThumbTemplate}"/>
                <Grid
                   x:Name="Measurer"
                   Grid.Column="1"
                   HorizontalAlignment="Stretch"
                   Background="Transparent">
                  <Interactivity:Interaction.Behaviors>
                    <Interactivity1:MeasurementBehavior></Interactivity1:MeasurementBehavior>
                  </Interactivity:Interaction.Behaviors>
                </Grid>
                <controls:GridSplitter
                   Width="{Binding ElementName=Measurer, Path=(Interactivity1:MeasurementBehavior.ActualWidth)}"
                   Grid.Column="1"
                   HorizontalAlignment="Center"
                   Template="{StaticResource ZoombarRangeThumbTemplate}"/>
                <controls:GridSplitter
                   x:Name="UpperThumb"
                   Width="10"
                   Grid.Column="2"
                   HorizontalAlignment="Left"
                   Template="{StaticResource ZoombarRightThumbTemplate}"/>
              </Grid>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:BusyAnimation">
    <!--<Setter Property="IsRunning" Value="False" />-->
    <Setter Property="StepInterval" Value="100"/>
    <Setter Property="Foreground" Value="Gray"/>
    <Setter Property="Background" Value="Transparent"/>
    <!--<Setter Property="BorderBrush" Value="Black" />
    <Setter Property="BorderThickness" Value=".5" />-->
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:BusyAnimation">
          <Grid x:Name="Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid.Resources>
              <Internal:BoolToConstConverter x:Key="BoolToConstConverter">
              </Internal:BoolToConstConverter>
            </Grid.Resources>
            <vsm:VisualStateManager.VisualStateGroups>
              <vsm:VisualStateGroup x:Name="CommonStates">
                <vsm:VisualState x:Name="normal">
                  <Storyboard/>
                </vsm:VisualState>
                <vsm:VisualState x:Name="state1">
                  <Storyboard>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part6"
                       Storyboard.TargetProperty="Opacity"
                       To=".25"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part7"
                       Storyboard.TargetProperty="Opacity"
                       To=".5"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part8"
                       Storyboard.TargetProperty="Opacity"
                       To=".75"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part1"
                       Storyboard.TargetProperty="Opacity"
                       To="1"/>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="state2">
                  <Storyboard>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part7"
                       Storyboard.TargetProperty="Opacity"
                       To=".25"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part8"
                       Storyboard.TargetProperty="Opacity"
                       To=".5"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part1"
                       Storyboard.TargetProperty="Opacity"
                       To=".75"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part2"
                       Storyboard.TargetProperty="Opacity"
                       To="1"/>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="state3">
                  <Storyboard>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part8"
                       Storyboard.TargetProperty="Opacity"
                       To=".25"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part1"
                       Storyboard.TargetProperty="Opacity"
                       To=".5"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part2"
                       Storyboard.TargetProperty="Opacity"
                       To=".75"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part3"
                       Storyboard.TargetProperty="Opacity"
                       To="1"/>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="state4">
                  <Storyboard>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part1"
                       Storyboard.TargetProperty="Opacity"
                       To=".25"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part2"
                       Storyboard.TargetProperty="Opacity"
                       To=".5"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part3"
                       Storyboard.TargetProperty="Opacity"
                       To=".75"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part4"
                       Storyboard.TargetProperty="Opacity"
                       To="1"/>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="state5">
                  <Storyboard>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part2"
                       Storyboard.TargetProperty="Opacity"
                       To=".25"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part3"
                       Storyboard.TargetProperty="Opacity"
                       To=".5"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part4"
                       Storyboard.TargetProperty="Opacity"
                       To=".75"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part5"
                       Storyboard.TargetProperty="Opacity"
                       To="1"/>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="state6">
                  <Storyboard>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part3"
                       Storyboard.TargetProperty="Opacity"
                       To=".25"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part4"
                       Storyboard.TargetProperty="Opacity"
                       To=".5"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part5"
                       Storyboard.TargetProperty="Opacity"
                       To=".75"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part6"
                       Storyboard.TargetProperty="Opacity"
                       To="1"/>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="state7">
                  <Storyboard>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part4"
                       Storyboard.TargetProperty="Opacity"
                       To=".25"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part5"
                       Storyboard.TargetProperty="Opacity"
                       To=".5"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part6"
                       Storyboard.TargetProperty="Opacity"
                       To=".75"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part7"
                       Storyboard.TargetProperty="Opacity"
                       To="1"/>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="state8">
                  <Storyboard>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part5"
                       Storyboard.TargetProperty="Opacity"
                       To=".25"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part6"
                       Storyboard.TargetProperty="Opacity"
                       To=".5"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part7"
                       Storyboard.TargetProperty="Opacity"
                       To=".75"/>
                    <DoubleAnimation
                       Duration="0"
                       From="0"
                       Storyboard.TargetName="part8"
                       Storyboard.TargetProperty="Opacity"
                       To="1"/>
                  </Storyboard>
                </vsm:VisualState>
                <vsm:VisualStateGroup.Transitions>
                  <vsm:VisualTransition GeneratedDuration="0:0:0"/>
                </vsm:VisualStateGroup.Transitions>
              </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>
            <ContentPresenter
               x:Name="content"
               HorizontalAlignment="Stretch"
               VerticalAlignment="Stretch"
               Content="{TemplateBinding Content}"
               Opacity="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsRunning,Converter={StaticResource BoolToConstConverter},ConverterParameter=0.6}"/>
            <Canvas
               x:Name="part_container"
               HorizontalAlignment="Stretch"
               Margin="{TemplateBinding Padding}"
               VerticalAlignment="Stretch"
               MaxHeight="200"
               MaxWidth="200"
               Background="{TemplateBinding Background}"
               IsHitTestVisible="True"
               Visibility="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsRunning,Converter={StaticResource boolToVisibilityConverter}}">
              <Ellipse
                 x:Name="part1"
                 Fill="{TemplateBinding Foreground}"
                 Opacity="0"
                 Stroke="{TemplateBinding BorderBrush}"
                 StrokeThickness="{TemplateBinding BorderThickness}"
                 Visibility="{TemplateBinding Visibility}"/>
              <Ellipse
                 x:Name="part2"
                 Fill="{TemplateBinding Foreground}"
                 Opacity="0"
                 Stroke="{TemplateBinding BorderBrush}"
                 StrokeThickness="{TemplateBinding BorderThickness}"
                 Visibility="{TemplateBinding Visibility}"/>
              <Ellipse
                 x:Name="part3"
                 Fill="{TemplateBinding Foreground}"
                 Opacity="0"
                 Stroke="{TemplateBinding BorderBrush}"
                 StrokeThickness="{TemplateBinding BorderThickness}"
                 Visibility="{TemplateBinding Visibility}"/>
              <Ellipse
                 x:Name="part4"
                 Fill="{TemplateBinding Foreground}"
                 Opacity="0"
                 Stroke="{TemplateBinding BorderBrush}"
                 StrokeThickness="{TemplateBinding BorderThickness}"
                 Visibility="{TemplateBinding Visibility}"/>
              <Ellipse
                 x:Name="part5"
                 Fill="{TemplateBinding Foreground}"
                 Opacity="0"
                 Stroke="{TemplateBinding BorderBrush}"
                 StrokeThickness="{TemplateBinding BorderThickness}"
                 Visibility="{TemplateBinding Visibility}"/>
              <Ellipse
                 x:Name="part6"
                 Fill="{TemplateBinding Foreground}"
                 Opacity="0"
                 Stroke="{TemplateBinding BorderBrush}"
                 StrokeThickness="{TemplateBinding BorderThickness}"
                 Visibility="{TemplateBinding Visibility}"/>
              <Ellipse
                 x:Name="part7"
                 Fill="{TemplateBinding Foreground}"
                 Opacity="0"
                 Stroke="{TemplateBinding BorderBrush}"
                 StrokeThickness="{TemplateBinding BorderThickness}"
                 Visibility="{TemplateBinding Visibility}"/>
              <Ellipse
                 x:Name="part8"
                 Fill="{TemplateBinding Foreground}"
                 Opacity="0"
                 Stroke="{TemplateBinding BorderBrush}"
                 StrokeThickness="{TemplateBinding BorderThickness}"
                 Visibility="{TemplateBinding Visibility}"/>
            </Canvas>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:GroupBox">
    <Setter Property="BorderBrush" Value="DarkGray"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Padding" Value="6"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:GroupBox">
          <Grid Background="{TemplateBinding Background}">
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Border
               Grid.Row="1"
               Grid.RowSpan="2"
               BorderBrush="{TemplateBinding BorderBrush}"
               BorderThickness="{TemplateBinding BorderThickness}"
               CornerRadius="3">
              <Border.Clip>
                <GeometryGroup FillRule="EvenOdd">
                  <RectangleGeometry x:Name="FullRect" Rect="0,0,300,200"/>
                  <RectangleGeometry x:Name="HeaderRect" Rect="6,0,100,100"/>
                </GeometryGroup>
              </Border.Clip>
            </Border>
            <ContentPresenter
               Grid.Row="2"
               Margin="{TemplateBinding Padding}"
               Content="{TemplateBinding Content}"
               ContentTemplate="{TemplateBinding ContentTemplate}"/>
            <ContentControl
               x:Name="HeaderContainer"
               Grid.Row="0"
               Grid.RowSpan="2"
               HorizontalAlignment="Left"
               Margin="6,0,0,0">
              <ContentPresenter Margin="3,0,3,0" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"/>
            </ContentControl>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:PopupHeaderedContentControl">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:PopupHeaderedContentControl">
          <Border Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
              <ContentControl Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ></ContentControl>
              <Canvas>
                <Popup x:Name="Popup" HorizontalOffset="{TemplateBinding PopupHorizontalOffset}" VerticalOffset="{TemplateBinding PopupVerticalOffset}">
                  <Grid>
                    <Border
                                        x:Name="ShadowBorder"
                                        HorizontalAlignment="Stretch"
                                        Opacity="1.0"
                                        BorderThickness="0">
                      <Border.Effect>
                        <DropShadowEffect></DropShadowEffect>
                      </Border.Effect>
                    </Border>
                    <Border
                                          x:Name="PopupBorder"
                                          HorizontalAlignment="Stretch"
                                          Opacity="1.0"
                                          BorderThickness="0">
                      <Border.RenderTransform>
                        <TranslateTransform X="1" Y="1" />
                      </Border.RenderTransform>
                      <Border.Background>
                        <SolidColorBrush Color="#11000000" />
                      </Border.Background>
                      <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
                        <ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}">
                        </ContentControl>
                      </Border>
                    </Border>
                  </Grid>
                </Popup>
              </Canvas>
              <Border x:Name="ClickHandler" Cursor="Hand" BorderThickness="0" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></Border>
            </Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="PopupStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0:0:0.1" To="PopupOpened" />
                  <VisualTransition GeneratedDuration="0:0:0.2" To="PopupClosed" />
                </VisualStateGroup.Transitions>
                <VisualState x:Name="PopupOpened">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="Opacity" To="1.0" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="PopupClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="Opacity" To="0.0" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
          </Border>

        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Geometry x:Key="RightArrow">M0,0 L5,3.5 0,7 z</Geometry>
  <Geometry x:Key="DownArrow">M0,3 L7,3 3.5,7 z</Geometry>
  <Geometry x:Key="OverflowArrow">F1 M7,0 L4,3 7,6 M3,0 L0,3 3,6</Geometry>
  <LinearGradientBrush x:Key="GradientBorderBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Color="White" Offset="0" />
    <GradientStop Color="#FFCECECE" Offset="1" />
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="ButtonMouseOver" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFFFFFFF" Offset="0"/>
    <GradientStop Color="#FFACDEF7" Offset="1"/>
  </LinearGradientBrush>
  <SolidColorBrush x:Key="BorderPressedBrush" Color="#CCA1A0B6"/>
  <SolidColorBrush x:Key="ContextMenuBackgroundBrush" Color="#FFF0F0F0" />
  <SolidColorBrush x:Key="MenuItemHighlightBorderBrush" Color="#FF80D4F6" />
  <LinearGradientBrush x:Key="MenuItemHighlightedBorderBackground" StartPoint="0.5,0" EndPoint="0.5,1">
    <GradientStop Offset="0" Color="#55D6E9FC"/>
    <GradientStop Offset="1" Color="#5596E3FF"/>
  </LinearGradientBrush>


  <Style x:Key="BreadcrumbContextMenu" TargetType="{x:Type ContextMenu}" >
    <!--<Setter Property="Background"  Value="{StaticResource ContextMenuBackgroundBrush}" />
        <Setter Property="FontFamily"
                Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}"/>
        <Setter Property="FontSize"
                Value="{DynamicResource {x:Static SystemFonts.MenuFontSizeKey}}"/>
        <Setter Property="FontStyle"
                Value="{DynamicResource {x:Static SystemFonts.MenuFontStyleKey}}"/>
        <Setter Property="FontWeight"
                Value="{DynamicResource {x:Static SystemFonts.MenuFontWeightKey}}"/>
        <Setter Property="Foreground"
                Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
        <Setter Property="VerticalContentAlignment"
                    Value="Center"/>
        <Setter Property="BorderThickness"
                Value="1"/>
        <Setter Property="BorderBrush"
                Value="#FF959595"/>
        <Setter Property="Padding"
                Value="2"/>
        <Setter Property="Grid.IsSharedSizeScope"
                Value="true"/>
        <Setter Property="HasDropShadow"
                Value="{DynamicResource {x:Static SystemParameters.DropShadowKey}}"/-->
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ContextMenu}">
          <mwt:SystemDropShadowChrome Name="Shdw" Margin="200,0,0,0"
                                        Color="Transparent"
                                        SnapsToDevicePixels="true">
            <Border Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}">
              <Grid>
                <Rectangle Fill="#F1F1F1"
                           HorizontalAlignment="Left"
                           Width="28"
                           Margin="2"
                           RadiusX="2"
                           RadiusY="2"/>
                <Rectangle HorizontalAlignment="Left"
                           Width="1"
                           Margin="25,2,10,2"
                           Fill="#E2E3E3"/>
                <Rectangle HorizontalAlignment="Left"
                           Width="1"
                           Margin="26,2,10,2"
                           Fill="White"/>


                <ScrollViewer CanContentScroll="true"
                              Grid.ColumnSpan="2" Margin="1,0"
                              MaxHeight="400"
                              Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type FrameworkElement}, ResourceId=MenuScrollViewer}}">
                  <VirtualizingStackPanel Orientation="Vertical" IsItemsHost="true"
                                  Margin="{TemplateBinding Padding}"
                                  KeyboardNavigation.DirectionalNavigation="Cycle"
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"></VirtualizingStackPanel>
                  <!--<ItemsPresenter Margin="{TemplateBinding Padding}"
                                                    KeyboardNavigation.DirectionalNavigation="Cycle"
                                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>-->
                </ScrollViewer>
              </Grid>
            </Border>
          </mwt:SystemDropShadowChrome>
          <ControlTemplate.Triggers>
            <Trigger Property="HasDropShadow"
                     Value="true">
              <Setter TargetName="Shdw"
                      Property="Margin"
                      Value="0,0,5,5"/>
              <Setter TargetName="Shdw"
                      Property="Color"
                      Value="#71000000"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <ControlTemplate x:Key="BaseBreadcrumbButton" TargetType="{x:Type Button}">
    <Border x:Name="border"
    Background="{TemplateBinding Background}"
    BorderBrush="{TemplateBinding BorderBrush}"
    BorderThickness="{TemplateBinding BorderThickness}"
    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
      <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{TemplateBinding Padding}"/>
    </Border>
  </ControlTemplate>

  <Geometry x:Key="NormalArrow">M0,0 L4,3.5 0,7 z</Geometry>
  <Geometry x:Key="ExpandedArrow">M0,3 L7,3 3.5,7 z</Geometry>

  <LinearGradientBrush x:Key="mouseOverBtnBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Color="#FFEAF6FD" Offset="0"/>
    <GradientStop Color="#FFD7EFFC" Offset="0.5"/>
    <GradientStop Color="#FFBDE6FD" Offset="0.5"/>
    <GradientStop Color="#FFA6D9F4" Offset="1"/>
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="mousePressedBtnBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Color="#FFC2E4F6" Offset="0"/>
    <GradientStop Color="#FFC2E4F6" Offset="0.5"/>
    <GradientStop Color="#FFA9D9F2" Offset="0.5"/>
    <GradientStop Color="#FF90CBEB" Offset="1"/>
  </LinearGradientBrush>
  <SolidColorBrush x:Key="borderBrush" Color="#C0000000"/>
  <SolidColorBrush x:Key="borderShadowBrush" Color="#60000000"/>
  <BooleanToVisibilityConverter x:Key="boolToVisible"/>
  <ImageSourceConverter x:Key="imgConverter"/>

  <!--DropDownButtonTemplate-->
  <ControlTemplate TargetType="{x:Type ToggleButton}" x:Key="DropDownButtonTemplate">
    <local:AeroChrome  SnapsToDevicePixels="True" Focusable="False" x:Name="chrome"
        BorderBrush="{StaticResource borderBrush}"
        BorderThickness="1"
        RenderMouseOver="{TemplateBinding IsMouseOver}"
        RenderPressed="{TemplateBinding IsPressed}" >
      <local:AeroChrome.Content>
        <Path x:Name="arrow" Data="{StaticResource DownArrow}" SnapsToDevicePixels="True" VerticalAlignment="Center" HorizontalAlignment="Center" Fill="Black" Focusable="False"/>
      </local:AeroChrome.Content>
    </local:AeroChrome>
    <ControlTemplate.Triggers>
      <Trigger Property="IsFocused" Value="True">
        <Setter TargetName="chrome" Property="RenderMouseOver" Value="True"/>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <!--ButtonTemplate-->
  <ControlTemplate TargetType="{x:Type Button}" x:Key="ButtonTemplate">
    <Border Margin="-1,-1,0,-1" BorderBrush="{StaticResource borderBrush}" BorderThickness="1" Background="Transparent" SnapsToDevicePixels="True" Focusable="False">
      <local:AeroChrome  SnapsToDevicePixels="True" x:Name="chrome" Focusable="False"
      BorderBrush="{StaticResource borderBrush}"
      BorderThickness="1"
       Margin="-1"
      RenderMouseOver="{TemplateBinding IsMouseOver}"
      RenderPressed="{TemplateBinding IsPressed}"
      Content="{TemplateBinding Content}"/>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsFocused" Value="True">
        <Setter TargetName="chrome" Property="RenderMouseOver" Value="True"/>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <!--BreadcrumbItem-->
  <Style TargetType="{x:Type local:BreadcrumbItem}">
    <Setter Property="Focusable" Value="False"/>
    <Setter Property="BorderBrush" Value="{StaticResource borderBrush}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:BreadcrumbItem}">
          <Border Background="Transparent" Focusable="False"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <DockPanel>

              <local:BreadcrumbButton x:Name="PART_Header"
                                      DataContext="{Binding}"
                                      IsImageVisible="{TemplateBinding IsRoot}"
                                      IsButtonVisible="{TemplateBinding IsButtonVisible}"
                                      ItemTemplate="{TemplateBinding OverflowItemTemplate}"
                                      ItemTemplateSelector="{TemplateBinding OverflowItemTemplateSelector}"
                                      IsDropDownPressed="{Binding IsDropDownPressed, RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}"
                                      SelectedItem="{Binding SelectedItem, RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}"
                                      Image ="{TemplateBinding Image}"
                                      Header="{TemplateBinding Header}" ItemsSource="{Binding Items, RelativeSource={RelativeSource TemplatedParent}}">
              </local:BreadcrumbButton>
              <ComboBox x:Name="PART_ComboBox" IsEditable="True" Visibility="Collapsed"/>
              <ContentControl x:Name="PART_Selected"  Focusable="False" Content="{TemplateBinding SelectedBreadcrumb}" />
            </DockPanel>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsRoot" Value="True">
              <Setter Property="EnableVisualButtonStyle" Value="False" TargetName="PART_Header"/>
            </Trigger>

          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <ControlTemplate x:Key="progressBarTemplate" TargetType="ProgressBar">
    <Grid Name="Background" SnapsToDevicePixels="True">
      <Rectangle Name="PART_Track" Margin="1,1,1,1" />
      <Decorator Name="PART_Indicator" Margin="1,1,1,1" HorizontalAlignment="Left">
        <Grid Name="Foreground">
          <Grid.ColumnDefinitions>
            <ColumnDefinition MaxWidth="15" />
            <ColumnDefinition Width="0.1*" />
            <ColumnDefinition MaxWidth="15" />
          </Grid.ColumnDefinitions>
          <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
          </Grid.RowDefinitions>
          <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Name="Indicator" Grid.ColumnSpan="3" Grid.RowSpan="2" />
          <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Name="Animation" OpacityMask="{x:Null}" Grid.ColumnSpan="3" Grid.RowSpan="2" />
          <Rectangle Name="LeftDark" Margin="1,1,0,1" Grid.RowSpan="2">
            <Rectangle.Fill>
              <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                <LinearGradientBrush.GradientStops>
                  <GradientStop Color="#0C000000" Offset="0" />
                  <GradientStop Color="#20000000" Offset="0.3" />
                  <GradientStop Color="#00000000" Offset="1" />
                </LinearGradientBrush.GradientStops>
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle RadiusX="1" RadiusY="1" Name="RightDark" Margin="0,1,1,1" Grid.Column="2" Grid.RowSpan="2">
            <Rectangle.Fill>
              <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                <LinearGradientBrush.GradientStops>
                  <GradientStop Color="#00000000" Offset="0" />
                  <GradientStop Color="#20000000" Offset="0.7" />
                  <GradientStop Color="#0C000000" Offset="1" />
                </LinearGradientBrush.GradientStops>
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle Name="LeftLight" Grid.Column="0" Grid.Row="2">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="1" RadiusY="1" RelativeTransform="1,0,0,1,0.5,0.5">
                <RadialGradientBrush.GradientStops>
                  <GradientStop Color="#60FFFFC4" Offset="0" />
                  <GradientStop Color="#00FFFFC4" Offset="1" />
                </RadialGradientBrush.GradientStops>
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle Name="CenterLight" Grid.Column="1" Grid.Row="2">
            <Rectangle.Fill>
              <LinearGradientBrush StartPoint="0,1" EndPoint="0,0">
                <LinearGradientBrush.GradientStops>
                  <GradientStop Color="#60FFFFC4" Offset="0" />
                  <GradientStop Color="#00FFFFC4" Offset="1" />
                </LinearGradientBrush.GradientStops>
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle Name="RightLight" Grid.Column="2" Grid.Row="2">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="1" RadiusY="1" RelativeTransform="1,0,0,1,-0.5,0.5">
                <RadialGradientBrush.GradientStops>
                  <GradientStop Color="#60FFFFC4" Offset="0" />
                  <GradientStop Color="#00FFFFC4" Offset="1" />
                </RadialGradientBrush.GradientStops>
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border Name="Highlight1" Grid.ColumnSpan="3" Grid.RowSpan="2">
            <Border.Background>
              <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                <LinearGradientBrush.GradientStops>
                  <GradientStop Color="#90FFFFFF" Offset="0.5385" />
                  <GradientStop Color="#00FFFFFF" Offset="0.5385" />
                </LinearGradientBrush.GradientStops>
              </LinearGradientBrush>
            </Border.Background>
          </Border>
          <Border Name="Highlight2" Grid.ColumnSpan="3" Grid.RowSpan="2">
            <Border.Background>
              <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                <LinearGradientBrush.GradientStops>
                  <GradientStop Color="#80FFFFFF" Offset="0.05" />
                  <GradientStop Color="#00FFFFFF" Offset="0.25" />
                </LinearGradientBrush.GradientStops>
              </LinearGradientBrush>
            </Border.Background>
          </Border>
        </Grid>
      </Decorator>
      <Border BorderThickness="{TemplateBinding Border.BorderThickness}" BorderBrush="{TemplateBinding Border.BorderBrush}" />
    </Grid>
  </ControlTemplate>


  <!--BreadcrumbBar-->
  <Style TargetType="{x:Type local:BreadcrumbBar}">
    <Setter Property="MinHeight" Value="23"/>
    <Setter Property="Background" Value="#A0FFFFFF"/>
    <Setter Property="BorderBrush" Value="{StaticResource borderBrush}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:BreadcrumbBar}">
          <ControlTemplate.Resources>
            <Style TargetType="{x:Type Button}">
              <Setter Property="Template" Value="{StaticResource ButtonTemplate}"/>
              <Setter Property="MinWidth" Value="21"/>
              <Setter Property="BorderThickness" Value="1"/>
              <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
              <Setter Property="BorderBrush" Value="Black"/>
              <Setter Property="Focusable" Value="{Binding Focusable, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:BreadcrumbBar}}}"/>
            </Style>
            <Style TargetType="{x:Type local:BreadcrumbButton}">
              <Setter Property="Focusable" Value="{Binding Focusable, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:BreadcrumbBar}}}"/>
            </Style>
          </ControlTemplate.Resources>
          <Border Background="{TemplateBinding Background}" SnapsToDevicePixels="True"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  Focusable="False"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" Focusable="False" SnapsToDevicePixels="True">
              <Grid Margin="-1">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto"/>
                  <ColumnDefinition Width="*"/>
                  <ColumnDefinition Width="Auto"/>
                  <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <ProgressBar x:Name="progress" Grid.Column="0" Grid.ColumnSpan="4"
                             Maximum="{Binding ProgressMaximum,RelativeSource={RelativeSource TemplatedParent}}"
                             Minimum="{Binding ProgressMinimum,RelativeSource={RelativeSource TemplatedParent}}"
                             Value="{Binding ProgressValue,RelativeSource={RelativeSource TemplatedParent}}"
                             Background="Transparent"
                             BorderThickness="0"
                             Template="{StaticResource progressBarTemplate}"/>
                <local:BreadcrumbButton  ItemsSource="{TemplateBinding CollapsedTraces}"  Grid.Column="0"
                                         x:Name="PART_Root"
                                         MinWidth="0"
                                         EnableVisualButtonStyle="False"
                                         Mode="{TemplateBinding OverflowMode}"
                                        SelectedItem="{Binding SelectedItem,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}"
                                        ItemTemplate="{TemplateBinding OverflowItemTemplate}"
                                         IsImageVisible="True"
                                         Image="{Binding SelectedBreadcrumb.Image, RelativeSource={RelativeSource TemplatedParent}}"
                                        ItemTemplateSelector="{TemplateBinding OverflowItemTemplateSelector}"
                                        IsDropDownPressed="{Binding IsOverflowPressed,RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" >
                </local:BreadcrumbButton>
                <ContentPresenter x:Name="container" Grid.Column="1" Content="{Binding RootItem,RelativeSource={RelativeSource TemplatedParent}}"/>
                <ToggleButton x:Name="dropDown" Grid.Column="2"
                              Focusable="False"
                              Width="16"
                              Visibility="Collapsed"
                              FocusVisualStyle="{x:Null}"
                              Template="{StaticResource DropDownButtonTemplate}"
                    ClickMode="Press"
                              IsChecked="{Binding IsDropDownOpen,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}"
                              Margin="-1"
                              BorderThickness="1"
                              BorderBrush="{StaticResource borderBrush}" />
                <ComboBox x:Name="PART_ComboBox"
                          Visibility="Hidden"
                          Margin="0,0,0,0"
                          IsEditable="True"
                          Focusable="True"
                          ItemTemplate="{TemplateBinding DropDownItemTemplate}"
                          ItemTemplateSelector="{TemplateBinding DropDownItemTemplateSelector}"
                          ItemsSource="{Binding DropDownItems,RelativeSource={RelativeSource TemplatedParent}}"
                          BorderThickness="0"
                          Grid.Column="0"
                          Text="{Binding Path=Path,RelativeSource={RelativeSource TemplatedParent},UpdateSourceTrigger=PropertyChanged}"
                          SelectedIndex="{Binding SelectedDropDownIndex,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}"
                          Grid.ColumnSpan="3"/>
                <ItemsControl  x:Name="buttons"  Grid.Column="3" Margin="1,0,-1,0" ItemsSource="{Binding Buttons,RelativeSource={RelativeSource TemplatedParent} }"  Focusable="False"  >
                  <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                      <StackPanel Orientation="Horizontal" IsItemsHost="True"/>
                    </ItemsPanelTemplate>
                  </ItemsControl.ItemsPanel>
                </ItemsControl>
              </Grid>
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="Visibility" Value="Visible" SourceName="PART_ComboBox">
              <!--hide the breadcrumb container and root button  if the combobox is visible, otherwise a breadcrumb button could get the focus on mouseover: -->
              <Setter Property="Visibility" Value="Hidden" TargetName="container"/>
              <Setter Property="Visibility" Value="Hidden" TargetName="PART_Root"/>
            </Trigger>
            <Trigger Property="IsRootSelected" Value="True">
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_Root"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Trigger.EnterActions>
                <BeginStoryboard>
                  <Storyboard>
                    <ColorAnimation Duration="0:0:0.3" To="White" Storyboard.TargetProperty="Background.Color"/>
                  </Storyboard>
                </BeginStoryboard>
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard>
                  <Storyboard>
                    <ColorAnimation Duration="0:0:0.3" From="White" Storyboard.TargetProperty="Background.Color"/>
                  </Storyboard>
                </BeginStoryboard>
              </Trigger.ExitActions>
            </Trigger>
            <Trigger Property="HasDropDownItems" Value="True">
              <Setter Property="Visibility" Value="Visible" TargetName="dropDown"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--BreadcrumbButton-->
  <Style TargetType="{x:Type local:BreadcrumbButton}">
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="Background" Value="{StaticResource mouseOverBtnBrush}"/>
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    <Setter Property="Template">

      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:BreadcrumbButton}">
          <Grid Margin="{TemplateBinding Padding}">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto"/>
              <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <local:AeroChrome Grid.Column="0"
                              Visibility="Visible"
                              x:Name="button"
                              Focusable="False"
                              Margin="-1"
                              BorderThickness="1"
                               RenderPressed="{TemplateBinding IsPressed}"
                              RenderMouseOver="{TemplateBinding IsMouseOver}">
              <local:AeroChrome.Content>
                <StackPanel Orientation="Horizontal">
                  <Image x:Name="image"  Source="{Binding Image, RelativeSource={RelativeSource TemplatedParent}}" Width="16" Height="16" Stretch="Fill"/>
                  <ContentPresenter Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Margin="2,0,2,0"/>

                </StackPanel>
              </local:AeroChrome.Content>
            </local:AeroChrome>

            <!--Content="{TemplateBinding Header}"/>-->
            <local:AeroChrome Grid.Column="1" x:Name="PART_DropDown"
                              Focusable="False"
                              MinWidth="16"
                              Margin="-1"
                              BorderThickness="1"
                               RenderPressed="{TemplateBinding IsDropDownPressed}"
                              RenderMouseOver="{TemplateBinding IsMouseOver}"
                              ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                          >
              <local:AeroChrome.Content>
                <Path x:Name="dropDownPath" Fill="Black" Data="{StaticResource RightArrow}" SnapsToDevicePixels="True"  HorizontalAlignment="Center"/>
              </local:AeroChrome.Content>
              <local:AeroChrome.ContextMenu>
                <ContextMenu x:Name="PART_Menu"
                              IsTextSearchEnabled="True"
                                 HorizontalOffset="50"
                               ItemContainerStyle="{x:Null}"
                                 IsOpen="{Binding IsDropDownPressed, RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}">
                  <ContextMenu.Template>
                    <ControlTemplate TargetType="ContextMenu" >
                      <mwt:SystemDropShadowChrome Color="#00FFFFFF" Name="Shdw" SnapsToDevicePixels="True" MaxHeight="400">
                        <Border BorderThickness="{TemplateBinding Border.BorderThickness}" BorderBrush="{TemplateBinding Border.BorderBrush}" Background="{TemplateBinding Panel.Background}">
                          <Grid>
                            <Rectangle RadiusX="2" RadiusY="2" Fill="#FFF1F1F1" Width="22" Margin="2,2,2,2" HorizontalAlignment="Left" />
                            <Rectangle Fill="#FFE2E3E3" Width="1" Margin="25,2,0,2" HorizontalAlignment="Left" />
                            <Rectangle Fill="#FFFFFFFF" Width="1" Margin="26,2,0,2" HorizontalAlignment="Left" />
                            <ScrollViewer CanContentScroll="True" Margin="1,0,1,0" Grid.ColumnSpan="2" VerticalScrollBarVisibility="Auto" >
                              <VirtualizingStackPanel Margin="{TemplateBinding Control.Padding}" IsItemsHost="True" IsVirtualizing="True" Orientation="Vertical" VirtualizationMode="Recycling" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Cycle"/>
                            </ScrollViewer>
                          </Grid>
                        </Border>
                      </mwt:SystemDropShadowChrome>
                      <ControlTemplate.Triggers>
                        <Trigger Property="ContextMenuService.HasDropShadow">
                          <Setter Property="FrameworkElement.Margin" TargetName="Shdw">
                            <Setter.Value>
                              <Thickness>0,0,5,5</Thickness>
                            </Setter.Value>
                          </Setter>
                          <Setter Property="mwt:SystemDropShadowChrome.Color" TargetName="Shdw">
                            <Setter.Value>
                              <Color>#71000000</Color>
                            </Setter.Value>
                          </Setter>
                          <Trigger.Value>
                            <System:Boolean>True</System:Boolean>
                          </Trigger.Value>
                        </Trigger>
                      </ControlTemplate.Triggers>
                    </ControlTemplate>
                  </ContextMenu.Template>
                </ContextMenu>
              </local:AeroChrome.ContextMenu>
            </local:AeroChrome>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsImageVisible" Value="False">
              <Setter Property="Visibility" Value="Collapsed" TargetName="image"/>
            </Trigger>
            <Trigger Property="Image" Value="{x:Null}">
              <Setter Property="Visibility" Value="Collapsed" TargetName="image"/>
            </Trigger>
            <Trigger Property="EnableVisualButtonStyle" Value="False">
              <Setter TargetName="button" Property="MouseOverBackground" Value="Transparent"/>
              <Setter TargetName="button" Property="MousePressedBackground" Value="Transparent"/>
              <Setter TargetName="button" Property="BorderBrush" Value="Transparent"/>
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="Header" Value="{x:Null}"/>
                <Condition Property="IsImageVisible" Value="False"/>
                <Condition Property="Image" Value="{x:Null}"/>
              </MultiTrigger.Conditions>
              <Setter Property="Visibility" Value="Collapsed" TargetName="button"/>
            </MultiTrigger>
            <Trigger Property="HasItems" Value="False">
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_DropDown"/>
            </Trigger>
            <Trigger Property="Mode" Value="Overflow">
              <Setter Property="Data" Value="{StaticResource OverflowArrow}" TargetName="dropDownPath"/>
              <Setter Property="Fill" Value="Transparent" TargetName="dropDownPath"/>
              <Setter Property="Stroke" Value="Black" TargetName="dropDownPath"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="RenderPressed" Value="True" TargetName="PART_DropDown"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True">
              <Setter Property="RenderMouseOver" Value="True" TargetName="PART_DropDown"/>
              <Setter Property="RenderMouseOver" Value="True" TargetName="button"/>
            </Trigger>
            <Trigger Property="IsDropDownVisible" Value="False">
              <Setter TargetName="PART_DropDown" Property="Visibility" Value="Collapsed"/>
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" SourceName="PART_DropDown"/>
                <Condition Property="EnableVisualButtonStyle" Value="True"/>
              </MultiTrigger.Conditions>
              <Setter Property="MouseOverBackground" Value="{StaticResource GradientBorderBrush}" TargetName="button"/>
            </MultiTrigger>
            <Trigger Property="IsButtonVisible" Value="False">
              <Setter Property="Visibility" Value="Collapsed" TargetName="button"/>
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsDropDownPressed" Value="True"/>
                <Condition Property="Mode" Value="Breadcrumb"/>
              </MultiTrigger.Conditions>
              <Setter Property="Data" Value="{StaticResource DownArrow}" TargetName="dropDownPath"/>
              <Setter Property="RenderPressed" Value="True" TargetName="button"/>
            </MultiTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type local:AeroChrome}">
    <Setter Property="MouseOverBackground" Value="{StaticResource mouseOverBtnBrush}"/>
    <Setter Property="MousePressedBackground" Value="{StaticResource mousePressedBtnBrush}"/>
    <Setter Property="BorderBrush" Value="{StaticResource borderBrush}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:AeroChrome}">
          <Grid Margin="{TemplateBinding Padding}">
            <Border x:Name="mouseOverBtn"
                        Opacity="0"
                        Background="{TemplateBinding MouseOverBackground}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        SnapsToDevicePixels="True">
              <Border x:Name="innerButton" SnapsToDevicePixels="True"
                          BorderThickness="1"
                          BorderBrush="White"/>
            </Border>
            <Border x:Name="mouseDownBtn"
                        Opacity="0"
                        Background="{TemplateBinding MousePressedBackground}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        SnapsToDevicePixels="True">
              <Border x:Name="innerButton2" SnapsToDevicePixels="False"
                          BorderThickness="1.2,1.2,0,0"
                          BorderBrush="{StaticResource borderShadowBrush}"/>
            </Border>
            <ContentPresenter Content="{TemplateBinding Content}"
                              x:Name="content"
                              VerticalAlignment="Center"
                              HorizontalAlignment="Center"
                              Margin="4,2,4,2"
                              ContentTemplate="{TemplateBinding ContentTemplate}"/>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="RenderMouseOver" Value="True">
              <Trigger.EnterActions>
                <BeginStoryboard>
                  <Storyboard >
                    <DoubleAnimation Storyboard.TargetName="mouseOverBtn" Storyboard.TargetProperty="Opacity" Duration="0:0:0.25" To="1"/>
                  </Storyboard>
                </BeginStoryboard>
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard>
                  <Storyboard >
                    <DoubleAnimation Storyboard.TargetName="mouseOverBtn" Storyboard.TargetProperty="Opacity" Duration="0:0:0.25" To="0"/>
                  </Storyboard>
                </BeginStoryboard>
              </Trigger.ExitActions>
            </Trigger>
            <Trigger Property="RenderPressed" Value="True">
              <Setter Property="Opacity" TargetName="mouseDownBtn" Value="1"/>
              <Setter Property="Margin" TargetName="content" Value="5,3,3,1"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="{x:Type local:EditableTextBlock}"
     TargetType="{x:Type local:EditableTextBlock}">
    <Setter Property="Foreground"
        Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="Background"
        Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
    <Setter Property="BorderBrush"
        Value="{StaticResource TextBoxBorder}"/>
    <Setter Property="BorderThickness"
        Value="1"/>
    <Setter Property="Padding"
        Value="1"/>
    <Setter Property="AllowDrop"
        Value="true"/>
    <Setter Property="FocusVisualStyle"
        Value="{x:Null}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:EditableTextBlock}">
          <Grid>
            <TextBlock x:Name="PART_TextBlock"
           Visibility="{Binding IsEditMode,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource boolToVisibilityConverter},ConverterParameter=false}"
           FontFamily="{TemplateBinding FontFamily}"
           FontStyle="{TemplateBinding FontStyle}"
           FontWeight="{TemplateBinding FontWeight}"
           FontStretch="{TemplateBinding FontStretch}"
           FontSize="{TemplateBinding FontSize}"
           Foreground="{TemplateBinding Foreground}"
           Background="Transparent"
           LineHeight="{TemplateBinding LineHeight}"
           LineStackingStrategy="{TemplateBinding LineStackingStrategy}"
           Text="{TemplateBinding Text}"
           TextAlignment="{TemplateBinding TextAlignment}"
           TextTrimming="{TemplateBinding TextTrimming}"
           TextWrapping="{TemplateBinding TextWrapping}">
            </TextBlock>
            <TextBox   x:Name="PART_TextBox"
           Visibility="{Binding IsEditMode,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource boolToVisibilityConverter},ConverterParameter=true}"
           FontFamily="{TemplateBinding FontFamily}"
           FontStyle="{TemplateBinding FontStyle}"
           FontWeight="{TemplateBinding FontWeight}"
           FontStretch="{TemplateBinding FontStretch}"
           FontSize="{TemplateBinding FontSize}"
           Foreground="Black"
           Background="{TemplateBinding Background}"
           TextAlignment="{TemplateBinding TextAlignment}"
           TextWrapping="{TemplateBinding TextWrapping}"
           AcceptsReturn="false">

            </TextBox>
          </Grid>
          <!--<ControlTemplate.Triggers>
            <Trigger Property="IsEnabled"
                     Value="false">
              <Setter TargetName="Bd"
                      Property="Background"
                      Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
              <Setter Property="Foreground"
                      Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>-->
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="local:StackedTreeViewControl">
    <!--<Setter Property="ContentItemsPanel">
      <Setter.Value>
        <ItemsPanelTemplate>
          <StackPanel Orientation="Vertical" />
        </ItemsPanelTemplate>
      </Setter.Value>
    </Setter>
      <Setter Property="DockedItemsPanel">
        <Setter.Value>
          <ItemsPanelTemplate>
            <StackPanel Orientation="Vertical" />
          </ItemsPanelTemplate>
        </Setter.Value>
      </Setter>-->
    <Setter Property="ContentItemTemplate">
      <Setter.Value>
        <DataTemplate>
          <Grid>
            <ContentPresenter />
          </Grid>
        </DataTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="DockedItemTemplate">
      <Setter.Value>
        <DataTemplate>
          <Grid>
            <ContentPresenter />
          </Grid>
        </DataTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="ContentItemContainerStyle">
      <Setter.Value>
        <Style TargetType="TreeViewItem">
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="TreeViewItem">
                <Grid>
                  <Grid x:Name="LayoutRoot">
                    <VisualStateManager.VisualStateGroups>
                      <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal" />
                        <VisualState x:Name="MouseOver" />
                        <VisualState x:Name="Pressed" />
                        <VisualState x:Name="Disabled" />
                      </VisualStateGroup>
                      <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Unfocused" />
                        <VisualState x:Name="Focused" />
                      </VisualStateGroup>
                      <VisualStateGroup x:Name="ValidationStates">
                        <VisualState x:Name="Valid" />
                        <VisualState x:Name="InvalidUnfocused">
                          <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="Visibility">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                            </ObjectAnimationUsingKeyFrames>
                          </Storyboard>
                        </VisualState>
                        <VisualState x:Name="InvalidFocused">
                          <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="Visibility">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationToolTip" Storyboard.TargetProperty="IsOpen">
                              <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                  <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                              </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                          </Storyboard>
                        </VisualState>
                      </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <Border Margin="0"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="{TemplateBinding Padding}">
                      <ScrollViewer x:Name="ScrollViewer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                    Background="{x:Null}"
                                    BorderBrush="Transparent" BorderThickness="0" HorizontalScrollBarVisibility="Auto"
                                    IsTabStop="False" VerticalScrollBarVisibility="Hidden">
                        <ItemsPresenter Margin="5" HorizontalAlignment="Stretch" />
                      </ScrollViewer>
                    </Border>
                  </Grid>
                </Grid>
              </ControlTemplate>
            </Setter.Value>
          </Setter>

        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="DockedItemContainerStyle">
      <Setter.Value>
        <Style TargetType="TreeViewItem">
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="TreeViewItem">
                <Grid>
                  <Grid x:Name="LayoutRoot">
                    <VisualStateManager.VisualStateGroups>
                      <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal" />
                        <VisualState x:Name="MouseOver" />
                        <VisualState x:Name="Pressed" />
                        <VisualState x:Name="Disabled" />
                      </VisualStateGroup>
                      <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Unfocused" />
                        <VisualState x:Name="Focused" />
                      </VisualStateGroup>
                      <VisualStateGroup x:Name="ValidationStates">
                        <VisualState x:Name="Valid" />
                        <VisualState x:Name="InvalidUnfocused">
                          <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="Visibility">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                            </ObjectAnimationUsingKeyFrames>
                          </Storyboard>
                        </VisualState>
                        <VisualState x:Name="InvalidFocused">
                          <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="Visibility">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationToolTip" Storyboard.TargetProperty="IsOpen">
                              <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                  <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                              </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                          </Storyboard>
                        </VisualState>
                      </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <Border Margin="0"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="{TemplateBinding Padding}">
                      <ScrollViewer x:Name="ScrollViewer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                    Background="{x:Null}"
                                    BorderBrush="Transparent" BorderThickness="0" HorizontalScrollBarVisibility="Auto"
                                    IsTabStop="False" VerticalScrollBarVisibility="Hidden">
                        <ItemsPresenter Margin="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                      </ScrollViewer>
                    </Border>
                  </Grid>
                </Grid>
              </ControlTemplate>
            </Setter.Value>
          </Setter>

        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:StackedTreeViewControl">
          <Grid Margin="0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*" />
              <ColumnDefinition x:Name="DockedColumn" Width="Auto" />
            </Grid.ColumnDefinitions>

            <local:DockedTreeView x:Name="ScrollableContentTree_PART" Margin="0"
                          c:ItemContainerStyle="{StaticResource FilterTreeViewItem}"
                          ItemsSource="{TemplateBinding ItemsSource}"
                          ItemTemplate="{TemplateBinding ContentItemTemplate}"
                          Padding="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Hidden"
                          c:Style="{StaticResource FilterTreeViewStyle}" />

            <local:DockedTreeView x:Name="DockedFlatTree_PART" Grid.Column="1" Background="Transparent"
                          c:ItemContainerStyle="{StaticResource FlatTreeViewItem}"
                          ItemsSource="{TemplateBinding ItemsSource}"
                          ItemTemplate="{TemplateBinding DockedItemTemplate}"
                          ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Auto"
                          c:Style="{StaticResource FlatTreeViewStyle}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>
